﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ChessBoard
{
    class MoveEntry : IDrawable
    {
        private const int Left = 103;
        private const int Top = 4;
        public int StartRow { get; private set; }
        public int StartCol { get; private set; }
        public int EndRow { get; private set; }
        public int EndCol { get; private set; }
        public bool PlayerTurn { get; set; }
        private Frame frame;

        public MoveEntry()
        {
            frame = new Frame()
            {
                Width = 22,
                Height = 3,
                ForegroundColor = ConsoleColor.Yellow,
                BackgroundColor = ConsoleColor.Black,
                FrameSymbols = new FrameSymbol()
                {
                    TopLeftCorner = '┌',
                    TopRightCorner = '┐',
                    BottomLeftCorner = '└',
                    BottomRightCorner = '┘',
                    TopHorBorder = '─',
                    BotHorBorder = '─',
                    VertBorder = '│'
                }
            };

            this.PlayerTurn = true;
        }

        public void Draw(int x = Left, int y = Top)
        {
            Console.BackgroundColor = this.frame.BackgroundColor;
            Console.ForegroundColor = this.frame.ForegroundColor;
            frame.Draw(x, y);
            Console.SetCursorPosition(x + 1, y + 1);
            Console.Write(" ENTER MOVE:        ");
            Console.SetCursorPosition(x + 2, y + 3);
            Console.ForegroundColor = ConsoleColor.DarkYellow;
            Console.WriteLine("Move format: e2-e4");
            Console.CursorLeft = x + 2;
            Console.Write("Castle: 0-0, 0-0-0");
            Console.SetCursorPosition(x + 14, y + 1);
            Console.ForegroundColor = ConsoleColor.Yellow;
        }
    }
}
